<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head th:include="common_css :: commonHeader('资源库管理')"></head>
<body>
<!--搜索框-->
<form method="post" id="tabfrom">
    <div style="padding:2px" class="easyui-panel" title="数据查询">
        <table class="form-table">
            <tr>
                <td align="right">英文名称：</td>
                <td>
                    <input id="selKeyName" style="width:150px"/>
                </td>
                <td align="right" width="10%">中文名称：</td>
                <td>
                    <input id="selChineseName" style="width:150px"/>
                    <a class="easyui-linkbutton" iconCls='icon-search' onclick="doSearch();">查询</a>
                </td>
            </tr>
        </table>
    </div>
    <br>
</form>
<div id="toolbar">
    <shiro:hasPermission name="kettle:job:param:add">
        <a href="javascript:void(0)" class="easyui-linkbutton" iconcls="icon-add"
           onclick="addJobParam()">添加</a>
    </shiro:hasPermission>
    <shiro:hasPermission name="kettle:job:param:edit">
        <a href="javascript:void(0)" class="easyui-linkbutton" iconcls="icon-edit"
           onclick="editJobParam()">修改</a>
    </shiro:hasPermission>
    <shiro:hasPermission name="kettle:job:param:del">
        <a href="javascript:void(0)" class="easyui-linkbutton" iconcls="icon-cancel"
           onclick="delJobParam()">删除</a>
    </shiro:hasPermission>

    <a href="javascript:void(0)" class="easyui-linkbutton" iconcls="icon-world-go"
       onclick="exportTemplateXml()">模板导出</a>
    <a href="javascript:void(0)" class="easyui-linkbutton" iconcls="icon-upload"
       onclick="readFile.click()">模板导入</a>
</div>

<div id="dg"></div>

<div id="dlg" class="easyui-dialog" style="width:550px;height:410px"
     closed="true" modal="true" maximizable="true" resizable="true">
    <form id="myform" method="post">
        <div style="padding:20px">
            <table cellpadding="2px" cellspacing="0" class="form-table">
                <input type="hidden" class="easyui-validatebox" name="id"/>
                <tr>
                    <td align="right">英文名称：</td>
                    <td><input class="easyui-validatebox" name="keyName"
                               data-options="required:true" validType="english"
                               missingMessage="请输入正确的英文名称"/></td>
                </tr>
                <tr>
                    <td align="right">中文名称：</td>
                    <td><input class="easyui-validatebox" name="chineseName"
                               data-options="required:true" validType="chinese"
                               missingMessage="请输入正确的中文名称"/></td>
                </tr>
                <tr>
                    <td align="right">参数类型：</td>
                    <td>
                        <input name="ftype" id="ftype" editable="false"
                               class="easyui-combobox" data-options="required:true,prompt:'==请选择==',panelHeight:'auto', valueField: 'label', textField: 'value',
                                    data: [{ label: '1',  value: '无' },{ label: '2',  value: '字典' },{ label: '3',  value: 'SQL' }]"
                               missingMessage="请选择参数类型" validType="comboxValidate['ftype','请选择参数类型']"/>
                    </td>
                </tr>
                <tr>
                    <td align="right">数据类型：</td>
                    <td>
                        <input name="datatype" id="datatype" editable="false"
                               class="easyui-combobox" data-options="required:true,prompt:'==请选择==',panelHeight:'auto', valueField: 'label', textField: 'value',
                                    data: [{ label: '1',  value: '字符串' },{ label: '2',  value: '整数' },{ label: '3',  value: '布尔' }
                                    ,{ label: '4',  value: '年月日' },{ label: '5',  value: '日期' }]"
                               missingMessage="请选择数据类型" validType="comboxValidate['datatype','请选择数据类型']"/>
                    </td>
                </tr>
                <tr>
                    <td align="right">是否必填：</td>
                    <td>
                        <input name="required" id="required" editable="false"
                               class="easyui-combobox" data-options="prompt:'==请选择==',panelHeight:'auto', valueField: 'label', textField: 'value',
                                    data: [{ label: '1',  value: '是' },{ label: '2',  value: '否' }]"/>
                    </td>
                </tr>
                <tr>
                    <td align="right">默认值：</td>
                    <td><input class="easyui-validatebox" name="defaultValue"/></td>
                </tr>
                <tr>
                    <td align="right">状态：</td>
                    <td>
                        <input name="status" id="status" editable="false"
                               class="easyui-combobox" data-options="prompt:'==请选择==',panelHeight:'auto', valueField: 'label', textField: 'value',
                                    data: [{ label: '1',  value: '启用' },{ label: '2', value: '禁用'}]"/>
                    </td>
                </tr>
                <tr>
                    <td align="right">顺序：</td>
                    <td><input class="easyui-validatebox" name="sequence"
                               missingMessage="请输入字段位数,必须大于0正整数！" validType="integerZero"/></td>
                </tr>
            </table>
        </div>
    </form>
</div>

<div style="display: none;">
    <form id="subFile" enctype="multipart/form-data" method="post">
        <input accept="" name="multipartFile" type="file" id="readFile" onchange="importTemplateXml(this.value);">
    </form>
</div>
<div th:include="common_js :: commJS"></div>
<script type="text/javascript"
        th:src="@{/js/kettle/jobParam.js}"></script>
</body>
</html>
